﻿// ==================================================================================================
// Copyright(C) 2018 FI Ltd. All rights reserved.
//
// SYSTEM NAME	    : FI.Net Application Framework
// COMPONENT ID	    : FI.Core
// COMPONENT DESC   : The foundation component of the whole framework. 	
//
// CREATED DATE/BY  : 18 Aug 2018 / Tian Mi
//
// REVISION HISTORY :	
// DATE/BY			SR#/CS/PM#/OTHERS		DESCRIPTION OF CHANGE
// ==================================================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FI.Core
{
    /// <summary>
    /// Defines of the constants.
    /// </summary>
    public static class Constants
    {
        /// <summary>
        /// The namespace.
        /// </summary>
        public const string Namespace = "http://www.ncs.com.sg/";

        /// <summary>
        /// This static class defines all FI.Net configuration section name.
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
        public static class ConfigurationSections
        {
            /// <summary>
            /// The setting source
            /// </summary>
            public const string SettingSource = "FI.settingSource";

            /// <summary>
            /// FI.serviceLocation.
            /// </summary>
            public const string ServiceLocation = "FI.serviceLocation";

            /// <summary>
            /// FI.applicationContexts.
            /// </summary>
            public const string ApplicationContexts = "FI.applicationContexts";

            /// <summary>
            /// FI.auditTrail 
            /// </summary>
            public const string AuditTrail = "FI.auditTrail";

            /// <summary>
            /// FI.batchJob 
            /// </summary>
            public const string BatchJob = "FI.batchJob";

            /// <summary>
            /// FI.batchJob.internalProxy
            /// </summary>
            public const string BatchJobInternalProxy = "FI.batchJob.internalProxy";

            /// <summary>
            /// iconnect.batchjob.service.
            /// </summary>
            public const string BatchJobService = "FI.batchJob.service";

            /// <summary>
            /// FI.calendar 
            /// </summary>
            public const string Calendar = "FI.calendar";

            /// <summary>
            /// FI.codeTable 
            /// </summary>
            public const string CodeTable = "FI.codeTable";

            /// <summary>
            /// FI.dataMapping 
            /// </summary>
            public const string DataMapping = "FI.dataMapping";

            /// <summary>
            /// FI.dataAccess 
            /// </summary>
            public const string DbHelper = "FI.dataAccess";

            /// <summary>
            /// FI.hierarchy 
            /// </summary>
            public const string Hierarchy = "FI.hierarchy";

            /// <summary>
            /// FI.messaging 
            /// </summary>
            public const string Messaging = "FI.messaging";

            /// <summary>
            /// FI.sessionManagement 
            /// </summary>
            public const string SessionManagement = "FI.sessionManagement";

            /// <summary>
            /// FI.localization 
            /// </summary>
            public const string Localization = "FI.localization";

            /// <summary>
            /// FI.logging 
            /// </summary>
            public const string Logging = "FI.logging";

            /// <summary>
            /// FI.fileUploader 
            /// </summary>
            public const string FileUploader = "FI.fileUploader";

            /// <summary>
            /// FI.dataTransfer 
            /// </summary>
            public const string DataTransfer = "FI.dataTransfer";

            /// <summary>
            /// FI.security 
            /// </summary>
            public const string Security = "FI.security";

            /// <summary>
            /// FI.security.scheduler
            /// </summary>
            public const string SecurityScheduler = "FI.security.scheduler";

            /// <summary>
            /// FI.state 
            /// </summary>
            public const string State = "FI.state";

            /// <summary>
            /// FI.stringResource 
            /// </summary>
            public const string StringResource = "FI.stringResource";

            /// <summary>
            /// FI.commonSettings 
            /// </summary>
            public const string CommonSettings = "FI.commonSettings";

            /// <summary>
            /// FI.lms 
            /// </summary>
            [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Lms")]
            public const string Lms = "FI.lms";

            /// <summary>
            /// FI.messageCompression
            /// </summary>
            public const string MessageCompression = "FI.messageCompression";

            /// <summary>
            /// FI.instrumentation
            /// </summary>
            public const string Instrumentation = "FI.instrumentation";

            /// <summary>
            /// FI.web.mvc
            /// </summary>
            public const string ExceptionHandling4Mvc = "FI.exceptionHandling.mvc";

            /// <summary>
            /// FI.diagnostics
            /// </summary>
            public const string Diagnostics = "FI.diagnostics";

            /// <summary>
            /// FI.singPass
            /// </summary>
            public const string SingPass = "FI.singPass";


            /// <summary>
            /// FI.diagnostics.service
            /// </summary>
            public const string DiagnosticsService = "FI.diagnostics.service";

            /// <summary>
            /// FI.archive
            /// </summary>
            public const string Archive = "FI.archive";

            /// <summary>
            /// FI.reportingService
            /// </summary>
            public const string ReportingService = "FI.reportingService";

            /// <summary>
            /// FI.nam
            /// </summary>
            public const string Nam = "FI.nam";


            /// <summary>
            /// FI.edx
            /// </summary>
            [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Edx")]
            public const string Edx = "FI.edx";

            /// <summary>
            /// FI.authorization
            /// </summary>
            public const string Authorization = "FI.authorization";

            /// <summary>
            /// FI.approvalWorkflow
            /// </summary>
            public const string ApprovalWorkflow = "FI.approvalWorkflow";

            /// <summary>
            /// FI.caching
            /// </summary>
            public const string Caching = "FI.caching";

            /// <summary>
            /// FI.entityFramework
            /// </summary>
            public const string EntityFramework = "FI.entityFramework";

            /// <summary>
            /// FI.webApi
            /// </summary>
            public const string WebApi = "FI.webApi";

            /// <summary>
            /// FI.mail 
            /// </summary>
            public const string Mail = "FI.mail";
        }

        /// <summary>
        /// This static class defines the common configuration properties.
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
        public static class ConfigurationPropertyNames
        {
            /// <summary>
            /// The connection string name.
            /// </summary>
            public const string Database = "database";
            /// <summary>
            /// The endpoint name.
            /// </summary>
            public const string Endpoint = "endpoint";
            /// <summary>
            /// Application name.
            /// </summary>
            public const string ApplicationName = "applicationName";
            /// <summary>
            /// Service locator name.
            /// </summary>
            public const string ServiceLocator = "serviceLocator";

            /// <summary>
            /// The cache store
            /// </summary>
            public const string Cache = "cache";
        }


        /// <summary>
        /// This static class defines all of the component specific Performance Counter Category.
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
        public static class PerformanceCounterCategories
        {
            /// <summary>
            /// Core
            /// </summary>
            public const string Core = "FI.Net Core";


            /// <summary>
            /// Code Table
            /// </summary>
            public const string CodeTable = "FI.Net Code Table";
        }

        /// <summary>
        /// The Constants defined in CodeTable
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
        public static class CodeTable
        {
            /// <summary>
            /// Text Field Name.
            /// </summary>
            public const string TextField = "BindingText";

            /// <summary>
            /// Value Field Name.
            /// </summary>
            public const string ValueField = "BindingValue";

            /// <summary>
            /// The Model Metadata property for CodeCategory.
            /// </summary>
            public const string CodeCategoryMetadataProperty = "CodeCategory";

            /// <summary>
            /// The TemplateHint for DropDownList.
            /// </summary>
            public const string DropDownListTemplateHint = "DropDownList";

            /// <summary>
            /// The TemplateHint for ListBox.
            /// </summary>
            public const string ListBoxTemplateHint = "ListBox";

            /// <summary>
            /// The TemplateHint for RadioButtonList.
            /// </summary>
            public const string RadioButtonListTemplateHint = "RadioButtonList";

            /// <summary>
            /// The TemplateHint for CheckBoxList.
            /// </summary>
            public const string CheckBoxListTemplateHint = "CheckBoxList";
        }

        /// <summary>
        /// The Constants defined in CodeTable
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
        public static class WebApi
        {
            /// <summary>
            /// The constant of E-Tag.
            /// </summary>
            public const string ETag = "E-Tag";

            /// <summary>
            /// The constant of If-Match
            /// </summary>
            public const string IfMatch = "If-Match";

            /// <summary>
            /// The base url of sample.
            /// </summary>
            public const string SampleBaseUrl = "http://api.iconnect.com/";

        }

        private static string _assembliesVersion;

        /// <summary>
        /// The version of FI assemblies.
        /// </summary>
        public static string AssembliesVersion
        {
            get
            {
                if (string.IsNullOrEmpty(_assembliesVersion))
                    _assembliesVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
                return _assembliesVersion;
            }
        }
    }
}
